package com.zbkj.crmeb.merchant.admin.service;

import java.util.List;
import java.util.Set;

import com.baomidou.mybatisplus.extension.service.IService;
import com.common.PageParamRequest;
import com.github.pagehelper.PageInfo;
import com.zbkj.crmeb.export.vo.ProductExcelVo;
import com.zbkj.crmeb.front.request.IndexStoreProductSearchRequest;
import com.zbkj.crmeb.store.model.StoreProduct;
import com.zbkj.crmeb.store.model.StoreProductMer;
import com.zbkj.crmeb.store.model.StoreProductUpload;
import com.zbkj.crmeb.store.request.StoreProductRequest;
import com.zbkj.crmeb.store.request.StoreProductSearchRequest;
import com.zbkj.crmeb.store.response.StoreProductAttrValueResponse;
import com.zbkj.crmeb.store.response.StoreProductNormResponse;
import com.zbkj.crmeb.store.response.StoreProductResponse;
import com.zbkj.crmeb.store.response.StoreProductTabsHeader;

/**
* @author Mr.Zhang
* @description StoreProductService 接口
* @date 2020-05-27
*/
public interface MerStoreProductService extends IService<StoreProduct> {


    /**
     * 获取产品列表Admin
     * @param request
     * @param pageParamRequest
     * @return
     */
    PageInfo<StoreProductResponse> getList(StoreProductSearchRequest request, PageParamRequest pageParamRequest);

    /**
     * 商品sku分页列表
     * @Description:  
     * @author daigb 
     * @param @param request
     * @param @return
     * @return PageInfo<StoreProductAttrValueResponse>
     * @throws
     */
    PageInfo<StoreProductAttrValueResponse> selectSkuPage(StoreProductSearchRequest request);


    /**
     * 保存产品信息
     * @param storeProductRequest
     * @return
     */
    boolean save(StoreProductRequest storeProductRequest);

    boolean saveDrafts(StoreProductRequest storeProductRequest);

    /**
     * 更新产品信息
     * @param storeProductRequest
     * @return
     */
    boolean update(StoreProductRequest storeProductRequest);

    /**
     * 产品详情
     * @param id
     * @param flag 是否计算会员折扣价格
     * @param flag 是否小程序用户
     * @return
     */
    StoreProductResponse getByProductId(int id,Integer merId,boolean flag,boolean isUser, String groupId, boolean isCart);

    /**
     * 产品详情
     * @param id
     * @return
     */
    StoreProductMer getProductMerById(int id, Integer merId);

    /**
     * 产品详情
     * @param id
     * @return
     */
    StoreProductNormResponse getSupplierByProductId(int id, Integer merId);

    /**
     * 标准商品分页列表
     * @Description:  
     * @author daigb 
     * @param @param request
     * @param @param pageParamRequest
     * @param @return
     * @return PageInfo<StoreProductResponse>
     * @throws
     */
    PageInfo<StoreProduct> getNormList(StoreProductSearchRequest request, PageParamRequest pageParamRequest);

    /**
     *
     * @author cyz
     * @date 2021/5/18 15:14
     * @param request
     * @param pageParamRequest
     * @param merId
     * @return com.github.pagehelper.PageInfo<com.zbkj.crmeb.store.response.StoreProductResponse>
     */
    public PageInfo<StoreProductResponse> getMerchnatList(StoreProductSearchRequest request, PageParamRequest pageParamRequest,Integer merId);

    public List<StoreProductResponse> getMerchnatList(List<Integer> ids, Integer merId,boolean flag);

    List<StoreProductResponse> getFrontMerchnatList(List<Integer> ids, Integer merId,Integer  leaderId);

    List<StoreProductResponse> getFrontMerchnatList2(List<Integer> ids, Integer merId);

//    PageInfo<StoreProduct> selectProductList(IndexStoreProductSearchRequest request,PageParamRequest pageParamRequest);

    PageInfo<StoreProduct> getList(IndexStoreProductSearchRequest request, PageParamRequest pageParamRequest);

    /* 方法弃用 author: daigb
     * 获取推荐商品
     * @param brandId 推荐同品牌商品
     * @param limit 最大数据量
     * @return 推荐商品集合
     */
//    List<StoreProduct> getRecommendStoreProduct(Integer brandId,Integer limit);

    PageInfo<StoreProduct> getShopProductList(IndexStoreProductSearchRequest request, PageParamRequest pageParamRequest);

    List<StoreProduct> getListV2(IndexStoreProductSearchRequest request, PageParamRequest pageParamRequest);

    List<StoreProductTabsHeader> getTabsHeader(int type, Integer merId);

    List<ProductExcelVo> getExportList(StoreProductSearchRequest request, PageParamRequest pageParamRequest, Integer merId);

    boolean transferCloud(Set<Integer> productIdList, Integer merId);

    List<StoreProductAttrValueResponse> openProduct(Integer productId, Integer merId);

    /**
     * 功能描述: 批量导入自建商品记录查询
     * @Param: [request, merId]
     * @Return: com.github.pagehelper.PageInfo<com.zbkj.crmeb.store.model.StoreProductUpload>
     * @Author: wangzh
     * @Date: 2022/12/23 10:15
     */
    PageInfo<StoreProductUpload> uploadList(PageParamRequest request, Integer merId);

    /**
     * 删除商品
     * @param productId 商品id
     * @return 删除结果
     */
    Boolean deleteProduct(Integer productId);

    /**
     * 功能描述: 获取指定用户购物车列表
     * @Param: [uid]
     * @Return: java.util.List<com.zbkj.crmeb.export.vo.ProductExcelVo>
     * @Author: wangzh
     * @Date: 2023/3/9 9:54
     */
    List<ProductExcelVo> getStoreCartProductByUid(Integer uid);

    /**
     * 功能描述: 搜索联想--返回包含关键字的商品名称
     * @Param: [keywords, merId]
     * @Return: java.util.List<java.lang.String>
     * @Author: wangzh
     * @Date: 2023/7/4 11:59
     */
    List<String> getProductNameByKeywords(String keywords, Integer merId);

    PageInfo<StoreProductResponse> getMerchnatList2(StoreProductSearchRequest request, PageParamRequest pageParamRequest,Integer merId);
}
